<?php

class base_templateEngine_CacheKeyBuilder {

    /**
     * Key for document tree
     * @param int $langId Language id
     * @param int $siteId Site id
     * @return string Key
     */
    public static function buildDocTreeKey($langId, $siteId) {
        return 'doctree-' . $langId . '-' . $siteId;
    }

    /**
     * Key for document id determined by path and site
     * @return string Key
     */
    public static function buildDocIdByPathKey($path, $siteId) {
        return 'doc_id_by_path-' . '/' . $path . '-' . ((int) $siteId);
    }

    public static function buildPageKeyByLangName($docPath, $langName, $siteId, $medium) {
        return 'page-path_' . $docPath . '-langName_' . $langName . '-site_' . $siteId . '-medium_' . $medium;
    }

    public static function buildPageKeyByLangId($docPath, $langId, $siteId, $medium) {
        return 'page-path_' . $docPath . '-langId_' . $langId . '-site_' . $siteId . '-medium_' . $medium;
    }

    public static function buildEnvKey($docPath, $langId, $siteId) {
        return 'env-vars_path_' . $docPath . '-langId_' . $langId . '-site_' . $siteId;
    }

    public static function buildImageKey($imgId, $width, $height) {
        return 'image_' . $imgId . '-width_' . $width . '-height_' . $height;
    }

    public static function buildImageMetaKey($imgId) {
        return 'imagemeta_' . $imgId;
    }

}